<%@ page import="java.util.List" %>
<%@ page import="bean.Announcement" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Iterator" %><%--
  Created by IntelliJ IDEA.
  User: 刘曼
  Date: 2023/6/27
  Time: 2:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<html>
<head>
    <title>展示公告</title>
</head>
<body>
<center>
  <div class="p-card tg-bg-white" p-role="tab" p-permanent-priority="0" style="min-height: 757px;">
    <ol class="breadcrumb" style="margin-bottom: 0">
      <li>
        <a href="Manager.jsp">管理员界面</a>
      </li>
      <li class="active">展示公告</li>
    </ol>
    <table border="1" width="700">
      <caption class="text-center">公告信息表</caption>
      <%--<c:forEach items="${alist}" var="auu">
        <tr>
          <td>${auu.announcement_num}</td>
          <td>${auu.announcement_title}</td>
          <td>${auu.content}</td>
        </tr>
      </c:forEach>--%>

      <table border="1" width="700">
        <tr class="active">
          <td width="100">公告编号</td>
          <td width="50">公告标题</td>
          <td width="100">公告内容</td>
        <td width="20">删除</td>
        </tr>
        <%
          List<Announcement> list= (List<Announcement>) request.getAttribute("alist");
          for(int i=0;i<list.size();i++){
        %>
          <%--<form align="center" action="delannouncement" method="post"  onsubmit="return on_submit()">--%>
          <tr>
              <td width="100"><%=list.get(i).getAnnouncement_num()%></td>
              <td width="50"><%=list.get(i).getAnnouncement_title()%></td>
              <td width="100"><%=list.get(i).getContent()%></td>
              <td width="20"><button><a href="delannouncement?announcement_num=<%=list.get(i).getAnnouncement_num()%>">删除</a></button></td>
          </tr>
          <%--</form>--%>
        <<%--tr>
            <form align="center" action="/delannouncement" method="post" id="form1" onsubmit="return on_submit()">
                    </form>&ndash;%&gt;
                    删除</button>
&lt;%&ndash;            <td><button><a href=/delannouncement?announcement_num=1'>删除</a></button></td>
            <td><button><a href='andelServlet?announcement_num=list.get(i).getAnnouncement_num()'>删除</a></button></td>&ndash;%&gt;
        </tr>--%>
        <%
          }
        %>
      </table>
    </table>
  </div>
</center>
</body>
</html>
